home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample SMSAM / SampleSMSAM Source / SampleSMSAMServer / SampleSMSAMServer.r < prev    next >
Encoding:
Text File  |  1995-07-28  |  7.3 KB  |  287 lines  |  [TEXT/KAHL]

  1. /*
  2.     File:        SampleSMSAMServer.r
  3.  
  4.     Copyright:    © 1991-1994 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Part of the AOCE Sample SMSAM Package.  Consult the license
  8.     which came with this software for your specific legal rights.
  9.  
  10. */
  11.  
  12.  
  13.  
  14. #define SystemSevenOrLater 1
  15. #define debug    true
  16.  
  17. #ifndef __TYPES.R__
  18. #include "Types.r"
  19. #endif
  20.  
  21. #ifndef __SYSTYPES.R__
  22. #include "SysTypes.r"
  23. #endif
  24.  
  25. /***********************************|****************************************/
  26.  
  27. #include "BovineConstants.h"
  28.  
  29. #define AllItems    0b1111111111111111111111111111111    /* 31 flags */
  30. #define NoItems        0b0000000000000000000000000000000
  31. #define MenuItem1    0b0000000000000000000000000000001
  32. #define MenuItem2    0b0000000000000000000000000000010
  33. #define MenuItem3    0b0000000000000000000000000000100
  34. #define MenuItem4    0b0000000000000000000000000001000
  35. #define MenuItem5    0b0000000000000000000000000010000
  36. #define MenuItem6    0b0000000000000000000000000100000
  37. #define MenuItem7    0b0000000000000000000000001000000
  38. #define MenuItem8    0b0000000000000000000000010000000
  39. #define MenuItem9    0b0000000000000000000000100000000
  40. #define MenuItem10    0b0000000000000000000001000000000
  41. #define MenuItem11    0b0000000000000000000010000000000
  42. #define MenuItem12    0b0000000000000000000100000000000
  43.  
  44. /***********************************|****************************************/
  45.  
  46. /* we use an MBAR resource to conveniently load all the menus */
  47.  
  48. #if debug
  49. resource 'MBAR' (kMenuBar, preload) {
  50.     { 
  51.         kAppleMenu,
  52.         kFileMenu,
  53.         kEditMenu,
  54.         kControlMenu,
  55.         kGatewayMenu,
  56.         kConfigMenu, 
  57.         kKeithMenu, 
  58.         kSteveMenu,
  59.         kChrisMenu,
  60.         kAddressesMenu
  61.     };
  62. };
  63. #else
  64. resource 'MBAR' (kMenuBar, preload) {
  65.     { 
  66.         kAppleMenu,
  67.         kFileMenu,
  68.         kEditMenu,
  69.         kControlMenu
  70.     };
  71. };
  72. #endif
  73.  
  74. /***********************************|****************************************/
  75.  
  76. resource 'MENU' (kAppleMenu, preload) {
  77.     kAppleMenu, textMenuProc,
  78.     AllItems & ~MenuItem2,    /* Disable dashed line, enable About and DAs */
  79.     enabled, apple,
  80.     {
  81.         "About BovineLeague…", noicon, nokey, nomark, plain;
  82.         "-", noicon, nokey, nomark, plain
  83.     }
  84. };
  85.  
  86. /***********************************|****************************************/
  87.  
  88. resource 'MENU' (kFileMenu, preload) {
  89.     kFileMenu, textMenuProc,
  90.     AllItems & ~MenuItem1 & ~MenuItem2 & ~MenuItem3 & 
  91.         ~MenuItem5 & ~MenuItem6 & ~MenuItem7 & ~MenuItem12,
  92.     enabled, "File",
  93.     {
  94.         "New", noIcon, nokey, nomark, plain;
  95.         "Open", noIcon, nokey, nomark, plain;
  96.         "-", noicon, nokey, nomark, plain;
  97.         "Close", noIcon, "W", nomark, plain;
  98.         "Save", noIcon, "S", nomark, plain;
  99.         "Save as…", noIcon, nokey, nomark, plain;
  100.         "-", noIcon, nokey, nomark, plain;
  101.         
  102.         "Show main window", noIcon, nokey, nomark, plain;
  103.         "Show log window", noIcon, nokey, nomark, plain;
  104.         "Show To: Applelink letter log", noicon, nokey, nomark, plain;
  105.         "Show To: AOCE Letter log", noicon, nokey, nomark, plain;
  106.         "-", noIcon, nokey, nomark, plain;
  107.         
  108.         "Quit",    noicon, "Q", nomark, plain
  109.     }
  110. };
  111.  
  112. /***********************************|****************************************/
  113.  
  114. resource 'MENU' (kEditMenu, preload) {
  115.     kEditMenu, textMenuProc,
  116.     AllItems & ~MenuItem2,    /* Disable dashed line, enable About and DAs */
  117.     enabled, "Edit",
  118.     {
  119.         "Undo", noicon, nokey, nomark, plain;
  120.         "-", noicon, nokey, nomark, plain;
  121.         "Cut", noicon, nokey, nomark, plain;
  122.         "Copy", noicon, nokey, nomark, plain;
  123.         "Paste", noicon, nokey, nomark, plain;
  124.         "Clear", noicon, nokey, nomark, plain;
  125.     }
  126. };
  127.  
  128. /***********************************|****************************************/
  129.  
  130. #if debug
  131.  
  132. resource 'MENU' (kControlMenu, preload) 
  133. {
  134.     kControlMenu, textMenuProc,
  135.     AllItems & ~MenuItem3 & ~MenuItem5 & ~MenuItem8,
  136.     enabled, "Control",
  137.     {
  138.         "Pause gateway", noicon, "P", nomark, plain;
  139.         "Step gateway", noicon, "S", nomark, plain;
  140.         "-", noIcon, nokey, nomark, plain;
  141.         "Show threads window", noicon, nokey, nomark, plain;
  142.         "-", noicon, nokey, nomark, plain;
  143.         "Show Memory Info", noicon, nokey, nomark, plain;
  144.         "Show Memory Info Often", noicon, nokey, nomark, plain;
  145.         "-", noicon, nokey, nomark, plain;
  146.         "Force quit", noicon, nokey, nomark, plain;
  147.     }
  148. };
  149.  
  150. #else
  151.  
  152. resource 'MENU' (kControlMenu, preload) 
  153. {
  154.     kControlMenu, textMenuProc,
  155.     AllItems & ~MenuItem3,
  156.     enabled, "Control",
  157.     {
  158.         "Pause gateway", noicon, nokey, nomark, plain;
  159.         "Hover gateway", noicon, nokey, nomark, plain;
  160.         "-", noIcon, nokey, nomark, plain;
  161.         "Force quit", noicon, nokey, nomark, plain;
  162.     }
  163. };
  164.  
  165. #endif
  166.  
  167. /***********************************|****************************************/
  168.  
  169. resource 'vers' (1) {
  170.     0x1,
  171.     0x0,
  172.     0x20,
  173.     0,
  174.     verUS,
  175.     "1.0d1",
  176.     "1.0d1 ©1991-94 Apple Computer, Inc." 
  177. };
  178.  
  179. /***********************************|****************************************/
  180.  
  181. resource 'BNDL' (128) {
  182.     'BLoJ',
  183.     0,
  184.     {    'FREF', { 0, 128 },
  185.         'ICN#',    { 0, 128 }
  186.     }
  187. };
  188.  
  189. resource 'FREF' (128) {
  190.     'APPL',0,""
  191. };
  192.  
  193.  
  194. data 'BLoJ' (128) {
  195.     $"0000"
  196. };
  197.  
  198. /***********************************|****************************************/
  199.  
  200. #define cAppleEventReply    40                // General command number used to process
  201.                                             // asynchronous replies
  202. #define cFinderNew            41                // <!> The user selected the tool icon in the
  203.                                             // Finder and chose "Open"
  204. #define cFinderPrint         42                // <!> The user selected document icons in
  205.                                             // the Finder and chose "Print"
  206. #define cFinderOpen            43                // <!> The user selected document icons in
  207.                                             // the Finder and chose "Open"
  208. #define cFinderQuit             44                // The user chose "Shutdown" or "Restart"
  209.                                             // the Finder sends a 'quit' AppleEvent
  210.  
  211. #define kAEDispatchTable                    400    
  212. #define kAdditionalAEDispatchTable            500    
  213.  
  214. type 'aedt' {
  215.     wide array {
  216.         unsigned longint    type;            /* Event class */
  217.         unsigned longint    creator;        /* Event ID */
  218.         unsigned longint    commandNumber;    /* Value */
  219.     };
  220. };
  221.  
  222. resource 'aedt' (kAEDispatchTable) {{            // Minimum for AppleEvent aware application
  223.     'aevt', 'ansr', cAppleEventReply;
  224.     'aevt', 'oapp', cFinderNew;
  225.     'aevt', 'odoc', cFinderOpen;
  226.     'aevt', 'pdoc', cFinderPrint;
  227.     'aevt', 'quit', cFinderQuit;
  228.     }
  229. };
  230.  
  231. #define cStatusLogInit         99 
  232. #define cItemsToBeMonitored 100 
  233. #define cStopMonitoring         101 
  234. #define cStatusSessionAlive     102 
  235. #define cMonitorCommand     103 
  236. #define cSetConfigCommand 104
  237. #define cGetConfigCommand 105
  238.  
  239. resource 'aedt' (kAdditionalAEDispatchTable) {{
  240.     'stmn','log ', cStatusLogInit;
  241.     'stmn','itms', cItemsToBeMonitored;
  242.     'stmn','stop', cStopMonitoring;
  243.     'stmn','alve', cStatusSessionAlive;
  244.     'stmn','butt', cMonitorCommand;
  245.     'stmn','sfig', cSetConfigCommand;
  246.     'stmn','gfig', cGetConfigCommand;
  247.  
  248.     }
  249. };
  250.  
  251. /***********************************|****************************************/
  252.  
  253. resource 'SIZE' (-1) {
  254.     dontSaveScreen,
  255.     acceptSuspendResumeEvents,
  256.     enableOptionSwitch,
  257.     canBackground,                
  258.                                 
  259.     doesActivateOnFGSwitch,    /* this says we do our own activate/deactivate; don't fake us out */
  260.     backgroundAndForeground,
  261.     dontGetFrontClicks,        
  262.     ignoreAppDiedEvents,
  263.     is32BitCompatible,    
  264.     
  265.     isHighLevelEventAware,
  266.     localAndRemoteHLEvents,
  267.     notStationeryAware,
  268.     reserved,
  269.     reserved,
  270.     reserved,
  271.     reserved,
  272.     2000*1024, 1024*1024    
  273. };
  274.  
  275. /***********************************|****************************************/
  276.  
  277. //    Include all of the appropriate icon suite resources
  278. #define ICONID    128
  279. #ifndef THINK_Rez
  280. include $$SHELL("BLJBovineServer")"SampleSMSAM Icons.rsrc" 'ICN#' (128) as 'ICN#' (ICONID);
  281. include $$SHELL("BLJBovineServer")"SampleSMSAM.rsrc" 'ICN#' (128) as 'ICN#' (ICONID);
  282. #else
  283. include "BovineServerIcons.rsrc" 'ICN#' (128) as 'ICN#' (ICONID);
  284. #endif
  285.  
  286. /***********************************|****************************************/
  287.